<template>
    <div>
        <el-table :data="list" row-key="id" :tree-props="{ children: 'children' }" default-expand-all border
            style="width: 100%">
            <el-table-column prop="id" label="用户编号" align="center">
            </el-table-column>
            <el-table-column prop="nickname" label="昵称" align="center">
            </el-table-column>
            <el-table-column prop="phone" label="手机号" align="center">
            </el-table-column>
            <el-table-column prop="status" label="状态" align="center">
                <template slot-scope="item">
                    <!-- item.row 代表的是table中的每一行数据 -->
                    <div>
                        <!-- {{item.row}} -->
                        <!-- {{ item.row.status == 1 ? "启用" : "禁用" }} -->
                        <el-tag v-if="item.row.status == 1" type="success">启用 </el-tag>
                        <el-tag type="danger" v-else> 禁用</el-tag>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作" align="center">
                <template slot-scope="item">
                    <el-button type="primary" icon="el-icon-edit" @click="edit(item.row.uid)" circle></el-button>

                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import { memberlist } from '../../request/app'
export default {
    data() {
        return {
            list: []
        };
    },
    methods: {
        look() {
            memberlist()
                .then(res => {
                    // console.log(res, '会员数据');
                    this.list = res.list
                })
        },

        // 修改
        edit(id) {
            // console.log(1111);
            this.$emit('isedit', id)
        },

    },
    // 计算属性
    computed: {

    },
    // 页面一加载
    mounted() {
        memberlist()
            .then(res => {
                // console.log(res, '会员数据');
                this.list = res.list
            })
    },
    components: {
    },
}
</script>

<style scoped>
.img img {
    width: 100%;
}
</style>
